<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="themes/default/layout/public">

<head>
    <title th:text="|修改密码 - ${GlobalSetting.website.name}|"></title>

</head>
<div  layout:fragment="content">
    <div class="row">
        <!--左侧菜单-->
        <div th:replace="themes/default/layout/profile_menu"></div>

        <div id="main" class="settings col-md-10 form-horizontal">
            <h2 class="h3 post-title">修改密码</h2>
            <div class="row mt-30">
                <div class="col-md-8">
                    <form th:object="${user}" name="baseForm" id="base_form" th:action="${#request.getRequestURI()}" method="POST">
                        <div class="form-group" th:classappend="${error?.fields['oldPassword']}?'has-error'">
                            <label for="old_password" class="required control-label col-sm-3">当前密码</label>
                            <div class="col-sm-9">
                                <input name="oldPassword" id="old_password" type="password" maxlength="32" placeholder="当前密码" class="form-control" th:value="${dto.oldPassword}" />
                                <span class="help-block" th:if="${error?.fields['oldPassword']!=null}" th:utext="${error?.fields['oldPassword']}"></span>
                            </div>
                        </div>
                        <div class="form-group" th:classappend="${error?.fields['password']!=null}?'has-error'">
                            <label for="password" class="required control-label col-sm-3">新密码</label>
                            <div class="col-sm-9">
                                <input name="password" id="password" type="password" maxlength="32" placeholder="新密码" class="form-control" th:value="${dto.password}" />
                                <span class="help-block" th:if="${error?.fields['password']!=null}" th:utext="${error?.fields['password']}"></span>
                            </div>
                        </div>
                        <div class="form-group" th:classappend="${error?.fields['passwordConfirmation']!=null}?'has-error'">
                            <label for="passwordConfirmation" class="required control-label col-sm-3">确认新密码</label>
                            <div class="col-sm-9">
                                <input name="passwordConfirmation" id="password_confirmation" type="password" maxlength="32" placeholder="再次输入新密码" class="form-control" th:value="${dto.passwordConfirmation}" />
                                <span class="help-block" th:if="${error?.fields['passwordConfirmation']!=null}" th:utext="${error?.fields['passwordConfirmation']}"></span>
                            </div>
                        </div>
                        <div class="form-group" th:classappend="${error?.fields['imageCode']!=null}?'has-error'">
                            <label for="old_password" class="required control-label col-sm-3">验证码</label>
                            <div class="col-sm-4">
                                <input name="imageCode" type="text" maxlength="32" placeholder="请输入下方验证码" class="form-control" th:value="${imageCode}" />
                                <span class="help-block" th:if="${error?.fields['imageCode']!=null}" th:utext="${error?.fields['imageCode']}"></span>
                                <div class="mt-10"><a href="javascript:void(0);" id="reloadCaptcha"><img th:src="${GlobalSetting.irrigation.codeUrl}"></a></div>
                            </div>
                        </div>
                        <div class="form-action row">
                            <div class="col-sm-offset-3 col-sm-9">
                                <button class="btn btn-xl btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>